import './style/index.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import I18n from '@/i18n/index'
import Vant from 'vant'
import 'vant/lib/index.css'
import { useLocalStorage } from '@vueuse/core'

import enUS from 'vant/es/locale/lang/en-US.mjs'
import { Locale } from 'vant'
// svg图标
import 'virtual:svg-icons-register'
import SvgIcon from '@/components/SvgIcon/index.vue'

if (useLocalStorage('app-lang').value === 'en') {
  Locale.use('en-US', enUS)
} else {
  Locale.use('zh-CN')
}

import App from './App.vue'
import router from './router'

const app = createApp(App)

app.component('SvgIcon', SvgIcon)
app.use(Vant)
// app.use(Vant.Lazyload)
app.use(I18n)
app.use(createPinia())
app.use(router)

app.mount('#app')
